classdef dotsTestCase < TestCase
    
    methods
        function self = dotsTestCase(name)
            self = self@TestCase(name);
        end
        
        function setUp(self)
            self.grandReset;
        end
        
        function tearDown(self)
            self.grandReset;
        end
        
        function grandReset(self)
            dotsTheMachineConfiguration.reset;
            dotsTheSwitchboard.reset;
            
            dotsTestCase.applySharedProperties;
            dotsTheMessenger.reset;            
        end
    end
    
    methods (Static)
        function applySharedProperties
            global SHARED_PROP_STRUCT
            if ~isempty(SHARED_PROP_STRUCT)
                sharedProps = fieldnames(SHARED_PROP_STRUCT);
                for ii = 1:length(sharedProps)
                    prop = sharedProps{ii};
                    dotsTheSwitchboard.setSharedPropertyValue( ...
                        mode, SHARED_PROP_STRUCT.(prop));
                end
            end
        end
        
        function waitForLookSee
            global CONVENIENCE_MODE_STRUCT
            if ~isempty(CONVENIENCE_MODE_STRUCT)
                if isfield(CONVENIENCE_MODE_STRUCT, 'lookSee')
                    WaitSecs(CONVENIENCE_MODE_STRUCT.lookSee);
                end
            end
        end
    end
end